#pragma once

#include <QTcpSocket>
#include <QThread>
#include "databuffer.h"

class SocketThread : public QThread
{
    Q_OBJECT

public:
    SocketThread(qintptr socketDescriptor, QObject *parent = nullptr);
    ~SocketThread();
    void run();
    void sendData(const QByteArray& data);

private slots:
    void slotReceiveCmdMsg(const QString& strCMD, const QString& msg);

private:
    qintptr socketDescriptor_;
    DataBuffer dataBuffer_;
    QTcpSocket socket_;
};
